﻿// <copyright file="IPiece.cs" company="ALCPU">
// Copyright (c) 2010 All Right Reserved
// </copyright>
// <author>Arthur Liberman</author>
// <email>Arthur_Liberman@hotmail.com</email>
// <date>03-30-2010</date>
// <summary>Contains IPiece interface definition.</summary>

namespace ChessDefinitions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Interface defines a Chess piece
    /// </summary>
    public interface IPiece
    {
        /// <summary>
        /// Occurs when there is a game event.
        /// </summary>
        event PieceEvent GameEvent;

        /// <summary>
        /// Gets the color of the piece.
        /// </summary>
        /// <value>The color.</value>
        IPieceColor Color { get; }

        /// <summary>
        /// Gets or sets the object visually representing the piece in the game.
        /// </summary>
        /// <value>The representation object.</value>
        object RepresentationObject { get; set; }

        /// <summary>
        /// Gets the location of the piece.
        /// </summary>
        /// <value>The current location.</value>
        Position Position { get; }

        /// <summary>
        /// Gets the move options.
        /// </summary>
        /// <value>An array of all possible moves.</value>
        List<Position> MoveOptions { get; }

        /// <summary>
        /// Gets the attack options.
        /// </summary>
        /// <value>An array of all possible attacks.</value>
        List<Position> AttackOptions { get; }

        /// <summary>
        /// Gets all possible move options.
        /// </summary>
        /// <value>All move options.</value>
        List<Position> AllMoveOptions { get; }

        /// <summary>
        /// Moves the piece to the destination.
        /// </summary>
        /// <param name="destination">The destination.</param>
        /// <returns><c>true</c> if successful, <c>false</c> if not.</returns>
        bool MoveTo(Position destination);
        
        /// <summary>
        /// Attacks the specified target.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns><c>true</c> if successful, <c>false</c> if not.</returns>
        bool Attack(Position target);

        /// <summary>
        /// Dies by the specified attacker.
        /// </summary>
        /// <param name="attacker">The attacker.</param>
        void Die(IPiece attacker);
    }
}
